Skip to content

Persist Copilot CLI credentials across dev container rebuilds#1

Draft
CodeAlanDebug with Copilot wants to merge 2 commits into
mainfrom
copilot/persist-copilot-cli-cred-dev-container
Draft

Persist Copilot CLI credentials across dev container rebuilds#1
CodeAlanDebug with Copilot wants to merge 2 commits into
mainfrom
copilot/persist-copilot-cli-cred-dev-container

Conversation

Copilot AI commented Apr 28, 2026

Copy link
Copy Markdown

Copilot CLI stores its OAuth token in ~/.config/github-copilot/ inside the container. Without persistence, every container rebuild forces a full /login device-flow re-authentication.

Changes

  • .devcontainer/devcontainer.json — Adds a named Docker volume (copilot-cli-credentials) mounted at /home/vscode/.config/github-copilot. Named volume chosen over bind mount for cross-platform compatibility (works on Windows, macOS, Linux, and Codespaces). Delegates postStartCommand to a script.

    "mounts": [
      "source=copilot-cli-credentials,target=/home/vscode/.config/github-copilot,type=volume"
    ]
  • .devcontainer/startup.sh — New executable script that prints the ready message and checks for existing credential files, emitting a clear 🔑 status line: either "already signed in" or the exact command needed to authenticate.

  • 00-quick-start/README.md — Adds a Persisting Credentials in Dev Containers subsection under Authentication covering: a comparison table (local install / Codespace / local dev container), how the named volume works, first-time vs. rebuild vs. reset workflows, and how to re-authenticate when needed.

Original prompt

how to presist copilot cli cred in the dev container

The user has attached the following file paths as relevant context:

  • .github/copilot-instructions.md
  • AGENTS.md

Created from VS Code.

Copilot AI changed the title [WIP] Add instructions for persisting Copilot CLI credentials in dev container Persist Copilot CLI credentials across dev container rebuilds Apr 28, 2026
Copilot AI requested a review from CodeAlanDebug April 28, 2026 20:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants